#include<stdio.h>
#include<unistd.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<sys/types.h>
int main()
{
    close(1);
    umask(0000);
    int fd = open("test.txt",O_WRONLY | O_CREAT | O_TRUNC,0666);
    printf("fd=%d\n",fd);
    fprintf(stdout,"hello world\n");


    return 0;
}
